<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <title></title>
    [#include "/admin/include/admin_static.htm"]
    [#import "/admin/include/admin_pagination.ftl" as p/]
    <script>
        function del(id) {
            if (window.confirm("确定要删除该记录吗？")) {
                var options = {
                    dataType: "text",
                    url: '${path}/admin/advert/delete.aspx?id=' + id,
                    success: function (result) {
                       layui.msg(result, '${path}/admin/advert/list.aspx');
                    }
                };
                $("#form1").ajaxSubmit(options);
            }
            return false;
        }
    </script>

</head>
<body>
<div class="main_admin_content">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>广告位</legend>
    </fieldset>
    <form id="form1" method="post"></form>

    <a href="${path}/admin/advert/add.aspx"   class="layui-btn " style="width: 100px; heigth: 30px; line-height: 30px" >添加</a>

    <table class="layui-table">
        <colgroup>
            <col width="50">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
            <col width="80">
        </colgroup>
        <thead>
        <tr>
            <th>序号</th>
            <th>超链接</th>
            <th>状态</th>

            <th>类型</th>
            <th>图片说明</th>
            <th>图片</th>
            <th>添加人</th>
            <th>添加日期</th>
            <th>修改</th>
            <th>删除</th>
        </tr>
        </thead>
        [#list pptList as ppt]
            <tr>
                <td>${ppt_index+1}</td>
                <td><a href="${ppt.img_link}" target="_blank"
                       style="color: red;">${ppt.img_link}</a></td>
                <td>${(ppt.is_display==0)?string("隐藏","显示") }</td>
                <td>
                   [#if  ppt.category==1]  公告
                   [#elseif  ppt.category==2]移动端
                   [/#if]
                </td>
                <td>${ppt.explanation }</td>
                <td><a href="${ppt.img_src}" target="_blank"
                       style="color: red;"><img id="previe1" alt="" src="${ppt.img_src} "
                                                style="width: 118px; height: 44px;"/></a></td>
                <td>${ppt.add_person }</td>
                <td>
                   ${p2p_date_format(ppt.add_time,"yyyy-MM-dd HH:mm:ss" )}
                </td>
                <td><input type="button"
                           onclick="window.location.href='${path}/admin/advert/add.aspx?id=${ppt.id}'"
                           value="修改"  class="layui-btn " /></td>
                <td> <input type="button"
                                                                 onclick="del(${ppt.id })"
                                                                 value="删除" class="layui-btn "/></td>
            </tr>
        [/#list]

    </table>

    [@p.pager pager = page url = "${path}/admin/advert/list.aspx" /]

</div>
</body>
</html>